/*
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

Copyright (c) 2023-present Kaleidos INC
*/

@import url("tools/typography.css");
@import url("../../styles/delete-comment-confirm.css");

:host {
  container-type: inline-size;
  display: block;
}

:host(.highlighted) {
  background: var(--color-primary10);
}

.comment {
  overflow: hidden;
  padding-block: var(--spacing-8);
}

.comment-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-block-end: var(--spacing-12);
}

.comment-options {
  flex-shrink: 0;
}

.creation-info {
  align-items: baseline;
  display: flex;
  flex-grow: 1;
  gap: var(--spacing-4);
  padding-inline-start: var(--spacing-8);

  &.no-user {
    align-items: center;
  }
}

.creation-data {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-4);
  justify-content: flex-start;
}

.creation-data-fullname {
  @mixin font-inline;

  color: var(--color-secondary);
}

.creation-data-username {
  @mixin font-inline;

  color: var(--color-gray60);
}

.creation-data-date {
  @mixin font-small;

  color: var(--color-gray80);
  font-style: italic;
}

.creation-data-edited {
  block-size: min-content;
}

.end-wrapper {
  column-gap: var(--spacing-8);
  display: flex;
}

.comment-content {
  padding-inline-start: var(--spacing-36);
}

.description-content {
  border-block-end: 1px solid var(--color-gray20);
  padding-block-end: var(--spacing-8);
}

.edit-comment-wrapper {
  display: flex;
  gap: var(--spacing-8);
  min-block-size: 140px;
  padding-block-start: var(--spacing-4);
  padding-inline-start: var(--spacing-8);
  position: relative;
}

.edit-comment-form {
  flex: 1;
}

.edit-field-actions {
  display: flex;
  gap: var(--spacing-8);
  inset-block-end: var(--spacing-24);
  inset-inline-end: var(--spacing-8);
  position: absolute;
}

.former-user-text {
  color: var(--color-gray70);
  font-style: italic;
}

.former-user-avatar {
  --no-user-avatar-size: 24px;
}

@container (inline-size < 280px) {
  .comment-top {
    align-items: flex-start;
  }

  .creation-data {
    flex-direction: column;
  }

  .separator {
    display: none;
  }
}
